package com.studyv3.test.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.studyv3.common.core.mapper.BaseMapperPlus;
import com.studyv3.test.domain.ApplyWaste;
import com.studyv3.test.domain.Stock;
import com.studyv3.test.domain.vo.ApplyWasteVo;
import com.studyv3.test.domain.vo.StockApplyWasteVo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * lb_报废申请/审批(ApplyWaste)表数据库访问层
 *
 * @author makejava
 * @since 2024-05-07 19:48:56
 */
public interface ApplyWasteMapper extends BaseMapperPlus<ApplyWasteMapper, ApplyWaste, ApplyWasteVo> {

//    @Select("<script>delete  " +
//            "from " +
//            "left join (select id as batchId,name as batchName from lb_batch) b on b.batchId=s.batch_id " +
//            "left join (select id,products_id,batch_id,applicant,flag,object_amount from lb_apply_waste where deleted = 0) la on s.batch_id = la.batch_id and s.products_id = la.products_id "+
//            "<where> " +
//            "<if test=\"applicant !=null and applicant !=''\"> and la.applicant = #{applicant} </if> " +
//            "<if test=\"flag !=null and flag !=''\"> and la.flag = #{flag} </if> " +
//            "<if test=\"productsId !=null and productsId !=''\"> and p.id = #{productsId} </if> " +
//            "<if test=\"batchId !=null and batchId !=''\"> and b.batchId = #{batchId} </if> " +
//            "<if test=\"productsName !=null and productsName !=''\"> and p.name like concat('%', #{productsName}, '%') </if> " +
//            "<if test=\"batchName !=null and batchName !=''\"> and b.batchName like concat('%', #{batchName}, '%') </if> </where></script>")
//    List<StockApplyWasteVo> listStockApplyWasteForManager(Stock stock);

    Boolean deleteBatch(List<Integer> ids);
}

